Implement bot reports and enhance user response fields#13
Merged
ValDesign22 merged 22 commits intofeat/integrationsfrom Apr 3, 2026
Merged
Implement bot reports and enhance user response fields#13ValDesign22 merged 22 commits intofeat/integrationsfrom
ValDesign22 merged 22 commits intofeat/integrationsfrom
Conversation
Nonolanlan1007
requested changes
Mar 28, 2026
Nonolanlan1007
approved these changes
Mar 28, 2026
Nonolanlan1007
requested changes
Apr 3, 2026
Nonolanlan1007
approved these changes
Apr 3, 2026
|
🎉 This PR is included in version 1.0.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces a new reports feature for bots (behind a feature flag), refactors bot access control logic to use model methods instead of service calls, and simplifies session and event management. The most significant changes are the addition of the reports API endpoints, improved access checks, and cleanup of unnecessary dependencies in route handlers.
New Reports Feature:
reportsmodule undersrc/api/routes/bots/bot/(gated by thereportsfeature flag), providing endpoints to subscribe, unsubscribe, and list report subscriptions for a bot. The endpoints enforce proper authorization and handle duplicate or missing subscriptions. (src/api/routes/bots/bot/reports/mod.rs,src/api/routes/bots/bot/mod.rs) [1] [2] [3]Access Control Refactor:
Replaced calls to
services.auth.user_has_bot_accessandservices.auth.user_owns_botwith directbot.has_accessandbot.is_ownermethod calls in all relevant bot, achievements, and event route handlers, improving readability and encapsulation. (src/api/routes/bots/bot/mod.rs,src/api/routes/bots/bot/achievements/mod.rs,src/api/routes/bots/bot/events/mod.rs,src/api/routes/bots/bot/events/event/mod.rs) [1] [2] [3] [4] [5] [6] [7] [8]Removed unnecessary
Servicesdependencies from route handler signatures and imports, further simplifying the code. (src/api/routes/bots/bot/mod.rs,src/api/routes/bots/bot/achievements/mod.rs,src/api/routes/bots/bot/events/mod.rs,src/api/routes/bots/bot/events/event/mod.rs) [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]Session and Event Management Improvements:
In the sessions API, improved the logic for marking the current session and refactored session revocation to use a new
revoke_many_for_userrepository method for efficiency. (src/api/routes/auth/sessions/mod.rs) [1] [2] [3]Cleaned up redundant code in the bot deletion handler by removing a duplicate existence check. (
src/api/routes/bots/bot/mod.rs)These changes collectively improve maintainability, security, and extensibility of the bot API.